﻿<my1:RibbonWindow
    xmlns:my1="clr-namespace:Fluent;assembly=Fluent"  
    x:Class="devtm.Editor.Configuration.formWpf.SelectAssembly"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:devtm.Types.LazyLoading;assembly=devtm.Types"    
    xmlns:d="clr-namespace:devtm.Editor.Configuration.formWpf"    
    Title="SelectAssembly" Height="500" Width="893" WindowStartupLocation="CenterScreen">
    <my1:RibbonWindow.Resources>

        <d:BoolVisibilityValueConverter x:Key="convertbool" />
        
        <DataTemplate DataType="{x:Type c:AssemblyGacNamespace}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Image  Margin="0,0,10,10" Width="32" Height="32"  Source="/devtm.Editor.Configuration;component/Images/containerAssembly.png" />
                <Image Grid.Column="0" 
                       Height="22" 
                       HorizontalAlignment="Left" 
                       Margin="3" 
                       Name="image1" 
                       Stretch="Fill" 
                       VerticalAlignment="Top" 
                       Width="22"
                       Source="/devtm.Editor.Configuration;component/Images/erreur.png"
                       Visibility="{Binding IsInError, Converter={StaticResource convertbool}, Mode=TwoWay}" />
                
                <Label Grid.Column="1" Content="{Binding Name}" Tag="{Binding .}" ToolTip="{Binding FullName}" />
            </Grid>
        </DataTemplate>

        <DataTemplate DataType="{x:Type c:AssemblyFileNamespace}">
            <Grid ToolTip="{Binding FullName}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Image  Margin="0,0,10,10" Width="32" Height="32"  Source="/devtm.Editor.Configuration;component/Images/fichier.png" />
                <Label Grid.Column="1" Content="{Binding Name}" Tag="{Binding .}" ToolTip="{Binding FullName}" />
            </Grid>
        </DataTemplate>

    </my1:RibbonWindow.Resources>
    
    <Grid>
        
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        
        <Grid>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="728" />
                <ColumnDefinition Width="143" />
            </Grid.ColumnDefinitions>

            <Grid Margin="0,55,6,0">
                
                    <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="250" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="42" />
                    <RowDefinition />
                        <RowDefinition />
                </Grid.RowDefinitions>

                <Grid Grid.ColumnSpan="2" Grid.Row="0" Margin="10,5,0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="57"  />
                        <ColumnDefinition Width="665*" />
                    </Grid.ColumnDefinitions>
                    <Label Content="Filter : " Grid.Row="0" />
                    <TextBox TextChanged="TextBox_TextChanged" Margin="6,0,0,0" Grid.Column="1" x:Name="textSearch" />
                </Grid>

                <TreeView Grid.Row="1" Grid.RowSpan="2" Margin="10,5,0,5" x:Name="TreeSelectType" SelectedItemChanged="TreeNodeSelectedChanged" />

                <ListBox Grid.Column="1" Grid.Row="1" x:Name="LstFile" SelectionChanged="LstFile_SelectionChanged" Margin="5,5,0,5" />

                <ListBox Grid.Column="1" Grid.Row="2" x:Name="LstType" Margin="5,5,0,5" SelectionChanged="LstType_SelectionChanged" MouseDoubleClick="TypeDoubleClick">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Image Margin="0,0,10,10" Source="/devtm.Editor.Configuration;component/Images/brique.png" />
                                <Label Grid.Column="1" Content="{Binding Name}" Tag="{Binding .}" ToolTip="{Binding FullName}" />
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                    
            </Grid>

            <Grid Grid.Column="1" Margin="0,80,0,0">
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="98*" />
                    <RowDefinition Height="245*" />
                </Grid.RowDefinitions>
                
                <Button Content="Select" 
                        Height="32" 
                        HorizontalAlignment="Left" 
                        Margin="23,25,0,0" 
                        Name="button1" 
                        VerticalAlignment="Top" 
                        Width="96" 
                        Click="button1_Click" />
                
                <Button Content="Cancel" 
                        Height="32" 
                        HorizontalAlignment="Left" 
                        Margin="23,73,0,0" 
                        Name="button2" 
                        VerticalAlignment="Top" 
                        Width="96" 
                        Click="button2_Click" 
                        Grid.RowSpan="2" />
                
                <Button Content="Add directory" 
                        Height="32" 
                        HorizontalAlignment="Left" 
                        Margin="23,68,0,0" 
                        Name="button3" 
                        VerticalAlignment="Top" 
                        Width="96" 
                        Grid.Row="1" 
                        Click="button3_Click" />
              
                <Button Content="Load all" Grid.Row="1" Height="31" HorizontalAlignment="Left" Margin="23,228,0,0" Name="button4" VerticalAlignment="Top" Width="96" FontStretch="Normal" Click="LoadAll" />
            </Grid>
        </Grid>

        <Label Grid.Column="0" Grid.Row="1" x:Name="txtbox" />

    </Grid>
</my1:RibbonWindow>
